package javaParser;
/*
 * RdfMethod.java
 *
 * Created on February 26, 2008, 12:35 PM
 *
 */

/**
 *
 * @author Tian, Juan
 */
import java.util.LinkedList;
public class RdfMethod extends RdfTreeNode{
    
    LinkedList <RdfMethod> calls;
    LinkedList<RdfParam> params;
    LinkedList <RdfException> exceptions;
    LinkedList<RdfNestClass> nestclasses;
    LinkedList<RdfNestInterface> nestinterfaces;
    private boolean flag = false;//is dummy?
    /** Creates a new instance of RdfMethod */
    public RdfMethod() {
        this("default");
    }
    public RdfMethod(String name) {
        this("default", name, null);
    }
    public RdfMethod(String name, String type){
        this("default", name, type);
    }
    public RdfMethod(String perfix, String name, String type) {
        super(perfix, name, type);
        calls = new LinkedList<RdfMethod>();
        params = new LinkedList<RdfParam>();
        exceptions = new LinkedList<RdfException>();
        nestclasses = new LinkedList<RdfNestClass>();
        nestinterfaces = new LinkedList<RdfNestInterface>();
    }
    public boolean addCalls(RdfMethod a) {
        return calls.add(a);
    }
    public boolean addParam(RdfParam a) {
        return params.add(a);
    }
    public boolean addException(RdfException a) {
        return exceptions.add(a);
    }
    public boolean addNestClass(RdfNestClass a) {
        return nestclasses.add(a);
    }
    public boolean addNestInterfaces(RdfNestInterface a) {
        return nestinterfaces.add(a);
    }
    public RdfMethod getCalls(int i){
        return calls.get(i);
    }
    public RdfParam getParam(int i) {
        return params.get(i);
    }
    public int sizeOfCalls() {
        return calls.size();
    }
    public boolean isDummy() {
        return flag;
    }
    public void setDummy() {
        flag = true;
    }    
    public int sizeOfParams() {
    	return params.size();
    }

}